<div class="chat-enter"
    data-ng-show="!message.nick"
>
    <h4>Enter a nick</h4>

    <div class="input-group col-md-4">
        <input id="nick" name="nick" class="form-control" type="text" placeholder="Enter a nickname"
           data-ng-model="nick"
           data-ui-keypress="{'enter': 'enterToChat($event)'}"
        />
        <span class="input-group-btn">
            <button class="btn btn-primary" type="button"
                data-ng-click="enterToChat()"
            >Enter to chat</button>
        </span>
    </div>
</div>

<div class="chat"
    data-ng-show="message.nick"
>
    <div class="row">
        <div id="messages" class="col-md-12 messages chat-screen">
            <ul class="list-unstyled">
                <li class="clearfix"
                    data-ng-repeat="message in messages | orderBy: 'createdAt'"
                >
                    <span class="pull-left time text-muted">
                        <code>[{{message.createdAt | amDateFormat:'YYYY-MM-DD HH:mm:ss'}}]</code>
                    </span>

                    <span class="pull-left message">
                        <span class="text-info">{{message.nick}}</span>
                        <span data-ng-bind-html="message.message | linky : '_blank'"></span>
                    </span>
                </li>
            </ul>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12 input-group">
            <div class="input-group-addon">
                {{message.nick}}
            </div>

            <input id="message" name="message" class="form-control" type="text" placeholder="enter chat message"
                data-ng-model="message.message"
                data-ui-keypress="{'enter': 'postMessage($event)'}"
            />

            <div class="input-group-btn">
                <button class="btn btn-primary" type="button"
                    data-ng-click="postMessage()"
                >
                    Send message
                </button>

                <button class="btn btn-danger" type="button"
                    data-tooltip="Leave chat"
                    data-ng-click="leaveChat()"
                >
                    <i class="fa fa-times"></i>
                </button>
            </div>
        </div>
    </div>
</div>